function select2(json){
	var id1=json.id1,id2=json.id2,defv1=json.defv1,defv2=json.defv2,data=json.data,nulltext1=json.nulltext1,nulltext2=json.nulltext2;
	create_op(id1,'',nulltext1,'C999');create_op(id2,'',nulltext2,'C999')
	data.map(function(e1){createop1(e1,id1,defv1);});
	id1.onchange = function(){
		id2.addClass('shake');
		id2.options.length = 0;
		create_op(id2,'',nulltext2,'C999')
		data.map(function(e1){
			if(e1.id==id1.options[id1.selectedIndex].value){
				e1.child.map(function(e2){createop2(e1.id,e2,id2,defv2);});
			}
		}.bind(id2));
	}
	function createop1(e1,id1,defv1){
		var option = create_op(id1,e1.id,e1.name);
		if(defv1==e1.id)option.selected=true;
		if(!zeai.empty(defv1)){
			id2.options.length = 0;
			create_op(id2,'',nulltext2)
			data.map(function(e1){
				if(e1.id==id1.options[id1.selectedIndex].value){
					e1.child.map(function(e2){createop2(e1.id,e2,id2,defv2);});
				}
			}.bind(id2));
		}
	}
	function createop2(e1id,e2,id2,defv2){
		var option = create_op(id2,e2.id,e2.name);
		if(defv1==e1id && defv2==e2.id)option.selected=true;
		
	}
	function create_op(obj,value,text,clsname){
		var op = document.createElement('option');
		var op_t = document.createTextNode(text);
		op.appendChild(op_t);op.value = value;op.className = clsname;
		obj.appendChild(op);
		return op;
	}
}